<div class="form form-horizontal">
    <div class="spacing-bottom-sm form-group" page-header="Manage quotes">
        <div class="col-sm-3">
            <input class="form-control" ng-model="customer" placeholder="Customer" ui-keypress="{13:'research(customer)'}" autofocus
                   typeahead-on-select="updateCustomer($item)" typeahead="customer as customer.name for customer in getCustomerList($viewValue)" />
        </div>
        <div class="col-sm-2">
            <input class="form-control" ng-model="filters.salesman" placeholder="Salesman name" type="text" ui-keypress="{13:'research(customer)'}" />
        </div>
        <div class="col-sm-6">
            <a class="btn btn-info" ui-sref="quote-new" has-access="QuoteCreate">
                <b class="glyphicon glyphicon-plus"></b> New quote
            </a>
            <button type="button" class="btn btn-info" csv-download="tableParams.data" ng-show="tableParams.data.length"
                    csv-headers="{'Quote#':'quoteNumber', 'Customer': 'companyName', 'Salesman': 'salesmanName', 'Quote Date': 'quoteDate'}">
                <b class="glyphicon glyphicon-download"></b> Export
            </button>
        </div>
    </div>
</div>
<table ng-table="tableParams" class="table table-hover table-bordered ng-table-resizable-columns" ng-visible="$data.length">
    <tr ng-repeat="item in $data">
        <td data-title="'QO#'" header-class="col-sm-1 width8"><span class="form-control-static">{{item.quoteNumber}}</span></td>
        <td data-title="'Quote date'" header-class="col-sm-1 width7"><span class="form-control-static">{{item.quoteDate | date: 'dd/MMM/yyyy'}}</span></td>
        <td data-title="'Customer'" header-class="col-sm-3 width30"><span class="form-control-static">{{item.companyName}}</span></td>


        <td data-title="'Notes'" header-class="col-sm-3 width25"><span class="form-control-static text-left">{{item.note}}</span></td>
        <td data-title="'Units'" header-class="col-sm-3 width2"><span class="form-control-static text-right">{{item.totalUnit| number:0}}</span></td>

        <td data-title="'Total'" header-class="col-sm-3 width7"><span class="form-control-static text-right">{{item.grandTotal| number:0}}</span></td>
        <td data-title="'Salesman'" header-class="col-sm-3 width9"><span class="form-control-static">{{item.salesmanName}}</span></td>
        <td data-title="'Status'" header-class="col-sm-3 width5"><span class="form-control-static"> {{showStatus(item.status)}}</span></td>

        <td class="text-center" header-class="col-sm-1 width5">
            <a ui-sref="quote-item({id: item.id})" class="btn btn-default">View</a>
        </td>
    </tr>
</table>
<div ng-show="!tableParams.settings().$loading && tableParams.data.length === 0" class="well text-center">No result</div>